<!DOCTYPE html>
<html   xmlns="http://www.w3c.org/1999/xhtml"
        xmlns:h="http://java.sun.com/jsf/html"
        xmlns:p="http://primefaces.org/ui"
        xmlns:f="http://xmlns.jcp.org/jsf/core">
    <h:head/>
    <h:body>
        <h:outputText value="Wait for 3 sec..."/>
        
        <p:idleMonitor timeout="3000" onidle="PF('idleDialog').show();" onactive="PF('idleDialog').hide();"/>
        
        <p:dialog header="What's happening?" widgetVar="idleDialog" modal="true">
            <h:outputText value="Dude, are you there?" />
        </p:dialog>
    </h:body>
</html>
